package io.gitee.cofenghen.jdbctempleplus.core;

import io.gitee.cofenghen.jdbctempleplus.BaseJdbcTemplePlus;
import io.gitee.cofenghen.jdbctempleplus.exception.OrmException;
import io.gitee.cofenghen.jdbctempleplus.support.QueryCondition;

import java.util.List;

public interface IOrmTemplate {
      BaseJdbcTemplePlus ado();
    /**
     *
     * @param entity
     * @param <T>
     * @return
     */
    <T> int insert(T entity) throws OrmException;;
    <T>  int batchInsert(List<T> entities) throws OrmException;;
    <T>  T queryById(Class<T> entityClass,Object id) throws OrmException;
    <T>  List<T> query(Class<T> entityClass, QueryCondition<T> conditio);
    <T>  QueryCondition<T>  query(Class<T> entityClass);
    <T>  int updateById(Object id,T entity);
    <T> int deleteById(Class<T> entityClass,Object id);

//     <T> QueryBuilder<T> query(Class<T> entityClass);
//    <T> DeleteBuilder delete(Class<T> entityClass);
//    <T> UpdateBuilder update(Class<T> entityClass);
}